home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 6 / develop 6 code / TCP / NewsWatcher / NewsWatcher 2.0d15 source / source / ldefstub.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-02  |  1.3 KB  |  43 lines  |  [TEXT/KAHL]

  1. /*----------------------------------------------------------------------------
  2.  
  3.     ldefstub.c
  4.  
  5.     This module contains a stub for NewsWatcher's LDEF.
  6.     
  7.     This module is compiled by the ldef.π project to build the stand-alone
  8.     LDEF 128 resource.
  9.     
  10.     This is only a very small stub used to call the main LDEF function in
  11.     the ldef.c module, which is part of the main newswatcher.π project.
  12.     
  13.     A pointer to the main LDEF function must be stored in the list record's
  14.     refcon field.
  15.     
  16.     Using the stub has two advantages:
  17.     
  18.     1. The main LDEF function can use global variables, call other functions,
  19.     and in general enjoy all the privileges of a "real" function as opposed
  20.     to a function in a stand-alone code resource.
  21.     
  22.     2. We don't have to remember to rebuild the stand alone LDEF resource
  23.     whenever we make changes to the data structures in glob.h.
  24.     
  25. ----------------------------------------------------------------------------*/
  26.  
  27.  
  28.  
  29. typedef void (*listDefFuncType) (short, Boolean, Rect *, Cell,
  30.     short, short, ListHandle);
  31.  
  32.  
  33. pascal void    main (short lMessage, Boolean lSelect, Rect *lRect, Cell lCell,
  34.     short lDataOffset, short lDataLen, ListHandle lHandle)
  35. {
  36.     listDefFuncType listDefFunc;
  37.     
  38.     if (lMessage == lInitMsg) return;
  39.     listDefFunc = (listDefFuncType)(**lHandle).refCon;
  40.     (*listDefFunc)(lMessage, lSelect, lRect, lCell, lDataOffset, lDataLen, lHandle);
  41. }
  42.  
  43.